//#include<stdio.h>
//#include<iostream>
//#include<sys/types.h>
//#include<sys/wait.h>
//#include<string.h>
//#include<string>
//#include<stdlib.h>
//#include<unistd.h>

#include"myshell.h"

#define SIZE 1024

int main()
{
    char commandstr[SIZE];

    while(true)
    {
        //0、初始化全局变量
        InitGlobal();
        //1、输入命令行提示符
        PrintCommandPrompt();
        //2、获取用户输入的字符串
        if(!GetCommandString(commandstr, SIZE)) continue;
        //3、解析输入的字符串
        ParseCommandString(commandstr);
        //检测内建命令
        if(BuiltInCommandExec()) continue;

        //5、执行
        ForkAndExec();

    }
    return 0;
}
